<?php


namespace app\member\controller;
use app\member\controller\db\ClassList;
use app\member\controller\db\Image;
use app\member\controller\db\Like;
use think\Controller;
use think\facade\Session;

class Visitor extends Controller
{
    public function index(){
        $image = new Image();
        $images = $image->selectAll();
        $likes = new Like();
        $classes = new ClassList();
        $this->assign("title","PhotoShare|游客模式")
             ->assign("images",$images)
             ->assign("likes",$likes->selectImageByAuthor(Session::get("login")))
            ->assign("thisClass","今日热图")
            ->assign("imageCount",$images->total())
             ->assign("classes",$classes->selectAllClass())
            ->assign("imageFirst",$image->selectFirst());
        return $this->fetch("index/visitor");
    }
}